<!doctype html>
<uieip type="page" value="login" debug="true" timeout="5000"></uieip>
<uieip type="reg" value="console"></uieip>
<html>

<head>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="js" src="/yqwin/src/yqwin.min" cache="false"></uieip>
    <title>adp</title>
</head>

<body>
    <script type="text/javascript">
        var $MidWin;

        $(function () {
            $.yqLoginstate(function (res) {
                //console.log(res);
                var topmenu_r = [{
                    id: "m_index",
                    text: "首页",
                    iconCls: "yqwin-btn-icon fa fa-home",
                    onClick: function () {
                        window.location.href = "/";
                    }
                }, {
                    id: "m_user",
                    text: res.row.login_name,
                    iconCls: "yqwin-btn-icon fa fa-user",
                    width: 20,
                    subs: [{
                        id: "m_uppass",
                        text: "修改密码",
                        iconCls: "yqwin-btn-icon-sub fa fa-key",
                        onClick: function () {
                            window.location.href = "/login/index.html";
                        }
                    }, 
                    $.yqFormMdi_fun("form_setup"), {
                        id: "m_power",
                        text: "退出",
                        iconCls: "yqwin-btn-icon-sub fa fa-power-off",
                        onClick: function () {
                            $.yqConfirm("", "是否确定退出？", function (tf) {
                                if (tf) {
                                    //var backurl = window.document.location.href;
                                    var backurl = window.location.protocol + '//' + window.location.host;
                                    window.top.location = "/login/logout.html?backurl=" + encodeURIComponent(backurl);

                                    // $.yqLogout(function (res) {
                                    //     if (res.error == 0) {
                                    //         var backurl = window.document.location.href;
                                    //         window.location.href = "/login/login.html?backurl=" + encodeURIComponent(backurl);
                                    //     }
                                    //     else {
                                    //         alert(res.info)
                                    //     }
                                    // });
                                }
                            });
                        }
                    }]
                },
               ];

                $("body").yqFormMdi({
                    pwin: $(window),       //父项页面容器
                    loadmenu: true,        //加载系统菜单
                    appno: 0,
                    topmenu_l: [],
                    topmenu_r: topmenu_r,
                    defedit: "/adp/desktop.html",
                    afterBindingTitle: function () {

                    },
                });
            });

            $MidWin = $("body");
            $.yqFormMdi_fun("midWin_set", $MidWin);
        });
    </script>
</body>

</html>